﻿using System;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using System.ComponentModel;

namespace Interscape.TwilioClient.Components
{

    /// <summary>
    /// A paged collection of <see cref="Recording">Recording</see> objects.
    /// </summary>
    [Serializable]
    [XmlRoot("Recordings")]
    public class RecordingList : PagedList<Recording>
    {
    }

    /// <summary>
    /// Recordings are generated when you use the Record Verb. Those recordings are hosted on Twilio's REST API for you to access. 
    /// </summary>
    [Serializable]
    public class Recording : BaseAccountInfo
    {

        #region Constructors

        /// <summary>
        /// Creates a new instance of the Recording object.
        /// </summary>
        public Recording() : base()
        {
        }

        /// <summary>
        /// Creates a new instance of the Recording object.
        /// </summary>
        /// <param name="sid">A 34 character string that uniquely identifies this resource.</param>
        public Recording(string sid) : base(sid)
        {
        }

        #endregion


        /// <summary>
        /// The call during which the recording was made.
        /// </summary>
        [XmlElement]
        public string CallSid { get; set; }

        /// <summary>
        /// The length of the recording, in seconds
        /// </summary>
        [XmlElement]
        [DefaultValue(0)]
        public int Duration { get; set; }

    }
}
